package com.witmore.neutron.ai.cognitive.others;

import com.witmore.neutron.ai.api.dto.MessageDTO;
import com.witmore.neutron.ai.api.enums.ChatClientType;
import com.witmore.neutron.ai.api.service.ChatClientAdapter;
import com.witmore.neutron.ai.db.entity.ModelConfigDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.codec.ServerSentEvent;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Flux;

/**
 * Description: OthersChatClientService
 * Author: 豆子高
 * Date: 2025/6/4 11:55
 */
@Slf4j
@Service
public class OthersChatClientService implements ChatClientAdapter {
    @Autowired
    private ModelRouterService modelRouterService;

    @Override
    public String generateResponse(ModelConfigDO modelConfigDO, MessageDTO messageBO) {
        log.info("Generating response using Others model: {}", modelConfigDO.getModelName());
        return modelRouterService.routeRequest(modelConfigDO, messageBO);
    }

    @Override
    public Flux<ServerSentEvent<String>> generateResponseStreamSSEFlux(ModelConfigDO modelConfigDO, MessageDTO messageBO) {
        return null;
    }

    @Override
    public ChatClientType getClientType() {
        return ChatClientType.Others;
    }
}
